package com.app.shortvideo.net.base

import java.io.Serializable

class BaseResponseBean<T> : Serializable {
    var status = false
    var message: String? = null
    var code: String? = null
    var data: T? = null

    val isSuccess: Boolean
        get() = ResponseCode.isRequestSuccess(code)
    val isInValidToken: Boolean
        get() = ResponseCode.isInValidToken(code)
    val isMastUpdate: Boolean
        get() = ResponseCode.isMastUpdate(code)
    val isLegal: Boolean
        get() = data != null

    override fun toString(): String {
        return "BaseResponseBean{" +
                "status=" + status +
                ", msg='" + message + '\'' +
                ", code='" + code + '\'' +
                ", data=" + data +
                '}'
    }
}